package de.rj.urwalking.loader;

import java.util.ArrayList;

import android.content.Context;
import de.rj.urwalking.db.DBSalientObject;
import de.rj.urwalking.db.ReadWritePostgreSQL;


/**
 * Used to load previously added salient objects from the database in a separate thread.
 * @author rjj
 *
 */
public class IndoorSalientObjectLoader extends AsyncLoader<ArrayList<DBSalientObject>> {

	

	public IndoorSalientObjectLoader(Context context) {
		super(context);
	}

	@Override
	public ArrayList<DBSalientObject> loadInBackground() {

		ReadWritePostgreSQL dbWrapper = new ReadWritePostgreSQL();
				
		ArrayList<DBSalientObject> salientObjects = dbWrapper.fetchIndoorSalientObjects();
		dbWrapper.closeConnection();				
		
		return salientObjects;
	}
}
